package com.kitbox.hl.meshow.bpm.service;


import com.kitbox.hl.meshow.bpm.bean.BPMLoclaTaskInfo;

public interface ILocalBpmService {
    /**
     * 获取用户
     * @param defKey
     * @param instId
     * @param orgId
     * @param nodeId
     * @return
     * @throws Exception
     */
    public String getUserByNodeIdOrgIdInstIdDefKey(String defKey, String instId, String orgId, String nodeId)throws Exception;
    /**
     *创建并启动流程【用户ID、流程定义名称、流程实例名称】  返回实例ID
     * @param userID
     * @param processDefName
     * @param processInstName
     * @param processInstDesc
     * @param isStart
     * @return
     */
    public String createProcessInstance(String userID, String processDefName, String processInstName)throws Exception;

    /**
     * 完成活动实例【用户ID、流程实例ID、业务变量名、业务变量值】  返回执行结果，0表示成功，-1失败,
     * @param userID    多人"," 逗号 隔开（user1,user2...）
     * @param instanceId
     * @param varName  业务变量名
     * @param varValue 业务变量值
     * @return
     * @throws Exception
     */
    public String finishWorkItemWithOption(String userID, String instanceId, String varName, String varValue) throws Exception;



    /**
     * 流程任务信息
     * @param instanceId
     * @return
     * @throws Exception
     */
    public BPMLoclaTaskInfo getProcessTaskByInstanceId(String instanceId) throws Exception;
    /**
     * 获取前驱  完成任务ID
     * @param instanceId
     * @return
     * @throws Exception
     */
    public String getHisTaskIdByInstanceId(String instanceId) throws Exception;

    /**
     * 获取前驱  完成任务
     * @param instanceId
     * @return
     * @throws Exception
     */
    public BPMLoclaTaskInfo getHisTaskByInstanceId(String instanceId) throws Exception;


    /**
     * 获取前驱  完成任务 的处理人
     * @param instanceId
     * @return
     * @throws Exception
     */
    public String getHisTaskAssigneeByInstanceId(String instanceId) throws Exception;



    /**
     * 获取节点的处理人
     * @param nodeId
     * @return
     * @throws Exception
     */
    public String getNodeUserByNodeId(String nodeId) throws Exception;

    /**
     * 获取下一节点的处理人
     * @param nodeId
     * @param processDefinitionId
     * @param varName
     * @param varValue
     * @return
     * @throws Exception
     */

    public String getNextNodeUserByNodeId(String nodeId, String processDefinitionId, String varName, String varValue) throws Exception;



    /**
     * 挂起流程实例
     * @param instanceId
     * @return
     * @throws Exception
     */
    public String suspendFlow(String instanceId) throws Exception;

    /**
     * 删除流程实例
     * @param instanceId
     * @return
     * @throws Exception
     */
    public String deleteFlow(String instanceId) throws Exception;




}
